﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Ch.Admin.Bfs.Sms.Sdmx.Utils;
using Ch.Admin.Bfs.Sms.Sdmx.IO.Xml;

namespace SdmxMl.Check
{
    public partial class DlgDiagnostic : Telerik.WinControls.UI.RadForm
    {
        private InternationalString infoString;

        public DlgDiagnostic()
        {
            InitializeComponent();
        }
        public void BindDiagnostic(List<SdmxInformationMessage> diagList)
        {
            infoString = new InternationalString();
            
            ucDiagnosticList.SelectCurrentLang(SdmxMl.Common.LangSupport.CurLang);
            ucDiagnosticList.BindDiagnostic(diagList);
            if (ucDiagnosticList.ErrorCount == 0 && ucDiagnosticList.WarnCount == 0)
            {
                infoString.Add(SdmxMl.Common.LangSupport.CurLang,"No error or warning detected");
            }
            else if (ucDiagnosticList.ErrorCount == 0)
            {
                infoString.Add(SdmxMl.Common.LangSupport.CurLang,
                    "No error detected, but some elements do not follow SMS guidelines");

            }
            else if (ucDiagnosticList.ErrorCount > 0)
            {
                infoString.Add(SdmxMl.Common.LangSupport.CurLang,
                    "Error detected, please contact metadata group for support");

            }

            ucInternationalizedBoxInfo.SetValue(infoString);
        }
    }
}
